home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
c_course.zip
/
READCHAR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-12-30
|
469b
|
21 lines
/* READCHAR.C putchar() if fopen points to NULL */
#include "stdio.h"
main()
{
FILE *funny;
int c;
funny = fopen("TENLINES.TXT","r");
if (funny == NULL) printf("File doesn't exist\n");
else {
do {
c = getc(funny); /* get one character from the file */
putchar(c); /* display it on the monitor */
} while (c != EOF); /* repeat until EOF (end of file) */
}
fclose(funny);
}